﻿/*
 * 由SharpDevelop创建。
 * 用户： xieen
 * 日期: 2013-08-14
 * 时间: 11:44
 * 
 * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件
 */
using System;

namespace GoF23Learning._02.Abstract_Factory.Refactor
{
	/// <summary>
	/// Description of Employee.
	/// </summary>
	public class HR
	{
		SalaryFactory salaryFactory;
		public HR(SalaryFactory factory)
		{
			salaryFactory = factory;
		}
		/// <summary>
		/// 获取
		/// </summary>
		public void CalculateSalary(){
 
			double result = 0; 
		 
			double baseSalary =salaryFactory.CreateBaseSalary().Calculate();
			double bonus = salaryFactory.CreateBonus().Calculate(baseSalary);
		    double  tax = salaryFactory.CreateTax().Calculate(baseSalary,bonus);
				 
			
			result =baseSalary+bonus-tax ;
			
			Console.WriteLine(result);
			
			//return result;
 
		}
		
	}
}
